STEP 10: Since my_rect's width and height change, we must recalculate the area every time we move the mouse.

  • In the LOGIC tab, click on and drag out Multiplication. Drop it inside the mouse_move block.
  • Change the name of the variable from my_var to rect_area.
  • Change the equation of rect_area from 2 * 3 to x * y.

We are multiplying x and y, since that is what we are now using as my_rect's width and height!

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)